/*#include "memory.h"
#include "multitasker.h" 
#include "paging.h" 

int initHeap = 0;

void* _sys_malloc(unsigned int size){
	int cantPages = size / PAGESIZE + ((size % PAGESIZE) ? 1 : 0);
//	return (void*) getFreePages(cantPages);
return 0;
}

void init_heap(){

  
  //Nro de paginas con las que inicia el heap
  	int cantPages=1;
  
  	memBlock_t memBlock = (memBlock_t) HEAP_PAGETABLE;

	memBlock->next = NULL;

	memBlock->cantPages = cantPages;
	memBlock->freeSpace = memBlock->cantPages * PAGESIZE - sizeof(struct memBlock_t);
	memBlock->freeMemory = memBlock + sizeof(struct memBlock_t);

  
}

void* _malloc(memBlock_t memBlock, unsigned int size){
	void * ret = NULL;
	memBlock_t newBlock = NULL;

	if(size > memBlock->freeSpace){
		
		if(memBlock->next == NULL){
			newBlock = _sys_malloc(size);
			if(newBlock == NULL){
				return NULL;
			}
			newBlock->next = NULL;
			newBlock->cantPages = size / PAGESIZE + ((size % PAGESIZE) ? 1 : 0);
			newBlock->freeSpace = newBlock->cantPages * PAGESIZE - sizeof(struct memBlock_t);
			newBlock->freeMemory = newBlock + sizeof(struct memBlock_t); 
			memBlock->next = newBlock;
			return _malloc(memBlock->next, size);
		}else{
			return _malloc(memBlock->next, size);
		}
	}else{
		ret = memBlock->freeMemory;
		memBlock->freeMemory += size;
		memBlock->freeSpace -= size;
		return ret;
	}
}


void* malloc(unsigned int size){	

  	if(!initHeap){
		init_heap();
		initHeap = 1;
	}

  
	memBlock_t  actualTaskMemory = (memBlock_t) HEAP_PAGETABLE;

	return (void*) _malloc(actualTaskMemory, size);
}



void _freeTaskMem(void *mem, int cantPages){
	int i = 0;
	for( i = 0; i < cantPages; i++){
		clearPage(((unsigned int) mem) + i * PAGESIZE);
	}
}

void freeTaskMem(memBlock_t mem){
	if(mem != NULL){
		if(mem->next == NULL){
			_freeTaskMem(mem, mem->cantPages);
		}else{
			freeTaskMem(mem->next);
			_freeTaskMem(mem, mem->cantPages);
		}
	}	
}
*/
